<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>开阔进程管理器</title>
    <script src="./jquery-1.12.4.min.js"></script>
    <script src="./layer/layer.js"></script>
	<script src="./eejs-api.min.js"></script>
    <style>
        html, body {
            width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden;-webkit-user-select: none;
        }
        .top {
            width: 100%; height: calc(100% - 24px); overflow: auto;
        }
        .process-table {
            width: 100%; height: 100%; font-size: 12px; background-color: #e5e5e5;
        }
        .process-table th {
            height: 23px; font-size: 13px;text-align: left; padding: 1px 5px; word-break: keep-all; white-space: nowrap;
            font-weight: 500; text-shadow: 1px 1px 1px #bdbdbd; color: #000000;background-color: #f5f5f5;
        }
        .process-table td {
            height: 21px; padding: 1px 5px; text-align: left; word-break: keep-all; white-space: nowrap; cursor: default;
        }
        .process-table .dtr {
            background-color: #ffffff; color: #3c3c3c; text-shadow: 1px 1px 1px #e0e0e0;
        }
		.process-table .dtr td {
            -webkit-user-select: text;
        }		
        .child-table tr {
            background-color: #fffed3; color: #3c3c3c; text-shadow: 1px 1px 1px #e0e0e0;
        }
        .process-table tr.dtr:hover {
            background-color: #fff45c; color: #0e0a44; text-shadow: 1px 1px 1px #cecece;
        }
        .process-table tr.dtr.active {
            background-color: #00cf0a !important; color: #ffffff !important;  text-shadow: 1px 1px 1px #005a24 !important;
        }
        .process-table tr.htr.active {
            background-color: #ffee95; color: #ffffff; text-shadow: 1px 1px 1px #e4c033;
        }
        .process-table tr.dtr.open {
            background-color: #d0d0d0; color: #000000; text-shadow: 1px 1px 1px #868686;
        }
        .process-table th.sort {
            cursor: pointer;
        }
        .process-table th.sort:hover {
            background-color: #FFEB3B;
        }
        .process-table .coltd {
            padding: 5px;
        }
        .bottom {
            height: 23px; font-size: 12px; line-height: 20px; border-top: 1px solid #c3c3c3;cursor: default;
        }
        .bottom > div {
            float: left; padding: 0 10px; height: 20px; margin-top:2px;  border-right: 1px solid #dddddd;cursor: default;
        }        
        .child-table {
            width: 100%; height: 100%; font-size: 12px; background-color: #cfded2;
        }
        .hidden {
            display: none;
        }
        .process-table .itd{ background-color: #ffffff !important;width: 20px !important;min-width: 20px !important;}
		.process-table .itd img{ margin-left: 2px; margin-top: 3px;}
		.process-table .ith{width: 20px !important;min-width: 20px !important;}
        .clone-table {
            position: fixed; z-index: 2; top: 0px; left: 0;background-color: #dddddd;
        }
        .clone th {
            height: 23px; font-size: 13px; text-align: left; word-break: keep-all;  white-space: nowrap; font-weight: 500;
            background-color: #f3f3f3; text-shadow: 1px 1px 1px #bdbdbd; color: #000000;cursor: default;
        }
		.child-table .td1 {
            width: 5%; min-width: 5%;max-width: 55px; text-align: right;-webkit-user-select: text;
        }
        .child-table .td2 {
            width: 45%; min-width: 45%;max-width: 45%; white-space: normal;word-break: break-all;-webkit-user-select: text;
        }
		#contentmenu {
			position: absolute; 
			width: 160px;
			padding: 5px 2px; 
			background: #ffffff;
			border: 1px solid #f0f0f0; 
			box-shadow: 2px 2px 4px 1px #b9b9b9;
			top: 10px;
			left: 10px; 
			border-radius: 3px;
		}
		.mitem {
			width: calc(100% - 22px); 
			height: 25px; 
			border: 1px solid #ffffff; 
			border-radius: 3px; 
			font-size: 13px; 
			line-height: 27px; 
			padding: 0 10px; 
			cursor: pointer; 
			float: left; 
			color: #5c6073
		}
		.mitem:hover {color: #0b99e6; border: 1px solid #d1dde8;}
		.msplit {
			width: 100%;
			height: 2px;
			margin-top: 2px;
			float: left;
			border-top: 1px solid #e6e6e6;
		}
		.mitem.disable {color: #d6d6d6;cursor: default;}
    </style>
</head>
<body>    
	<script type="text/javascript">
	ee.AppConfig({ "title": "进程管理器", "debug": false, "width": 1000,  "height": 650, "max": true, "min": true, "close": true, "resize": true, "border": true });
	</script>
	<div id="contentmenu" class="hidden">
		<div class="mitem close">结束进程</div>
		<div class="mitem opendir">打开进程目录</div>
		<div class="msplit"></div>
		<div class="mitem copyid">复制“进程ID”</div>
		<div class="mitem copyname">复制“进程名称”</div>
		<div class="mitem copypath">复制“进程路径”</div>
		<div class="msplit"></div>
		<div class="mitem memory">优化内存</div>
		<div class="mitem module">查看“模块列表”</div>
		<div class="mitem object">查看“对象列表”</div>
		<div class="msplit"></div>
		<div class="mitem flush">刷新列表</div>
		<div class="mitem search">搜索进程</div>
	</div>
    <div class="top">
        <table id="process_table" class="process-table" cellspacing="1" cellpadding="0">
            <thead><!--↑↓-->
                <th class="ith"><img src="icons/def.png" width="16" height="16" style="margin-left:2px;margin-top:4px;"/></th>
                <th class="sort" data-id="0">进程名称 <span></span></th>
                <th class="sort" data-id="1">进程ID <span></span></th>
                <th class="sort" data-id="2">父进程ID <span></span></th>
                <th class="sort" data-id="3">所属用户 <span></span></th>
                <th class="sort" data-id="4">内存占用 <span></span></th>
            </thead>
            <tbody id="data-body">
    
            </tbody>
        </table>
    </div>    
    <div class="bottom">
        <div class="threadnum">进程数：<span>0</span></div>
        <div class="cpuuse">CPU使用率：<span>0%</span></div>
        <div class="memoryuse">物理内存：<span>0%</span></div>
		<div class="loadwait hidden"><img src="icons/5.gif"/></div>
    </div>
    <script>
        var orderType = -1;
        var orderWay = 1;
		var data = [];

        function render(isf){
            $('#data-body').html('');
            var tpl = document.getElementById('tr.tpl').innerHTML;
            var htmls = [];
            for(var i = 0; i < data.length; i++){				
                changeDataInfo(i);
                htmls.push(parse(tpl, data[i]));
            }
            $('#data-body').html(htmls.join(''));

			if(isf){
				layer.msg('数据已更新');
			}
        }

		function changeDataInfo(i){
			try{
				data[i].path = ee.utils.unicode4ToAnsi(data[i].path);
			}catch(ex1){
				data[i].path = decodeURIComponent(unescape(data[i].path));
			}     
			try{
				data[i].winTitle = ee.utils.unicode4ToAnsi(data[i].winTitle);
			}catch(ex2){
				data[i].winTitle = decodeURIComponent(unescape(data[i].winTitle));
			}
			data[i].priority = parsePriority(data[i].priority);
		}
        
        function parse(tpl, param){
            return tpl.replace(/\{[a-zA-Z0-9]+\}/g, function(a, b){
                return param[a.replace(/[\{\}]+/g, "")];
            });
        }

		function flushData(){
			layer.msg('开始刷新数据');
			setTimeout(function(){
				loadProcessList(1);	
			}, 500); 
		}
        
		var pindex = 0;
        function setProcessData(arr, isf){
            if(arr){
				try{
					if(arr && arr.length){						
						$('.threadnum span').text(arr.length);
						data = arr;
						for(var i = 0; i < data.length; i++){
							data[i].icon = 'icons/def.png';
							data[i].memory = 0.01;
							data[i].winHwnd = '';
							data[i].winTitle = '';
							data[i].winClass = '';
							data[i].path = '';
							data[i].cmd = '';
							data[i].createTime
						}
						if(orderType != -1){
							order(orderType, orderWay, isf);
						} else {
							render(isf);
						}
						pindex = 0;
						startLoadInfo();
					}
				}catch(e){
					alert('数据解析错误：' + e);
				}
            }
        }

		function startLoadInfo(){
			var loading = false;
			
			var getMemory = function(hwnd, callback){
				ee.processMemoryUse({"hwnd": hwnd}, function(ret){
					ee.processClose({"hwnd": hwnd});
					if(ret.value){
						callback(true, ret.value);
					} else {
						callback(false);
					}
				});
			}
			var openProcess = function(pid, callback){
				ee.processOpen({"pid": pid, "permiss": 2035711}, function(ret){
					if(ret.hwnd){
						getMemory(ret.hwnd, callback);
					} else {
						callback(false);
					}
				});
			}
			var loadPInfo = function(i, pid){				
				openProcess(pid, function(flag, use){
					if(flag){
						var a = Number(use/(1024 * 1024)).toFixed(2)
						data[i].memory = a;
					} else {
						if(pid == 0){
							data[i].memory = 0.02;
						} else if(pid == 4){
							data[i].memory = 0.06;
						} else {
							data[i].memory = 0.1;
						}
					}
					$('.dtr.row' + pid + ' td:eq(5)').text(data[i].memory + " MB");
					pindex ++;
					loading = false;
				});
			};

			ee.processAdjustPrivate({"private": 20, "enable": true}, function(){
				//$('.loadwait').removeClass('hidden');
				/*var inter = setInterval(function(){
					if(!loading){
						if(pindex < data.length){
							loading = true;
							var obj = data[pindex];
							loadPInfo(pindex, obj.processId);
						} else {
							$('.loadwait').addClass('hidden');
							clearInterval(inter);
						}
					}
				}, 1000);*/
			});
		}

		function loadOtherInfo(pid){
			var i = getIndexById(pid);
			if(i != -1){
				ee.processGetpathId({"pid": pid}, function(ret){
					if(ret.value){
						data[i].path = ret.value;
						$('.htr.row'+pid+' .pa').text(data[i].path);
					} else {
						ee.systemGetSystemDir({}, function(r2){
							if(r2.value){
								if(pid == 0){
									data[i].path = r2.value;
								} else if(pid == 4){
									data[i].path = r2.value + "/System32";
								} else {
									data[i].path = r2.value + "/System32/" + data[i].name;
								}
								$('.htr.row'+pid+' .pa').text(data[i].path);
							}
						});
					}
				});
			
				ee.processOpen({"pid": pid, "permiss": 2035711}, function(ret){
					if(ret.hwnd){
						ee.processGetcmd({"hwnd": ret.hwnd}, function(r2){
							if(r2.value){
								data[i].cmd = ee.utils.unicode4ToAnsi(r2.value);
								$('.htr.row'+pid+' .cm').text(data[i].cmd);
							}
							ee.processClose({"hwnd": ret.hwnd});
						});
					}
				});				

				ee.processWindowHwnd({"pid": pid}, function(ret){
					if(ret.value){
						data[i].winHwnd = ret.value;
						$('.htr.row'+pid+' .wh').text(data[i].winHwnd);

						ee.windowGetTitle({"hwnd": ret.value}, function(r2){
							if(r2.title){
								data[i].winTitle = r2.title;
								$('.htr.row'+pid+' .wt').text(data[i].winTitle);
							}
						});

						ee.windowGetClass({"hwnd": ret.value}, function(r3){
							if(r3.className){
								data[i].winClass = r3.className;
								$('.htr.row'+pid+' .wc').text(data[i].winClass);
							}
						});
					}
				});
			}			
		}

        function pageLoaded(){
            loadProcessList(0);

			setInterval(function(){
				ee.processCpuUse({"size": 2}, function(ret){
					$('.cpuuse span').text((ret.value || 0) + '%');
				});
				ee.systemMemoryInfo({}, function(ret){
					$('.memoryuse span').text((ret.mo || 0) + '%');
				});
			}, 1000);

			var b = new ee.Browser();
			b.main({}, function(ret){
				var isctrl = false;
				b.onKeydown = function(r){
					console.info(r.keycode);
					if(r.keycode == 17){
						isctrl = true;
					}
				}
				b.onKeyup = function(r){
					console.info(r.keycode);
					if(isctrl && r.keycode == 70){
						showSearch();
					}
					isctrl = false;
				}
			});
        }

		function loadProcessList(){
			ee.processAll({}, function(ret){
				if(ret.list){					
					setProcessData(ret.list, true);
				}
			});
		}

        function parsePriority(p){
            var res = p;
            if(p == 4){
                res = "低(" + p + ")";
            } else if(p == 6){
                res = "低于标准(" + p + ")";
            } else if(p == 8 || p == 9){
                res = "普通(" + p + ")";
            } else if(p == 10 || p == 11){
                res = "高(" + p + ")";
            } else if(p == 13){
                res = "高于标准(" + p + ")";
            } else if(p == 24){
                res = "实时(" + p + ")";
            }
            return res;
        }

        Date.prototype.format = function(fmt)  {
            var o = {   
                "M+" : this.getMonth()+1,                 //月份   
                "d+" : this.getDate(),                    //日   
                "h+" : this.getHours(),                   //小时   
                "m+" : this.getMinutes(),                 //分   
                "s+" : this.getSeconds(),                 //秒   
                "q+" : Math.floor((this.getMonth()+3)/3), //季度   
                "S"  : this.getMilliseconds()             //毫秒   
            };   
            if(/(y+)/.test(fmt))   
                fmt = fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));   
            for(var k in o)   
                if(new RegExp("("+ k +")").test(fmt))   
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));   
            return fmt;   
        } 

		function compare(str1, str2){
			if(str1 == str2){
				return true;
			}
			if(!str1 || !str2){
				return str1 == str2;
			}
			str3 = str1.toLowerCase();
			str4 = str2.toLowerCase();
			return str3.indexOf(str4) != -1;
		}

        function showSearch(){
			if($('.layui-layer').length){
				return;
			}
            layer.prompt({title: '输入进程信息（支持模糊匹配），并确认', formType: 0}, function(str, index){
                layer.close(index);
				searchData(str);                
            });
        }

		function searchData(str){
			var index = 0;
            for(var i = 0; i < data.length; i++){
				var item = data[i];
				if(item.processId == str || compare(item.name, str)){
					index = i;
					$('.dtr').removeClass('active');
					$('.htr').addClass('hidden');					
					$('.dtr.row' + item.processId).addClass('active');
					$('.htr.row' + item.processId).removeClass('hidden');
					setTimeout(function(){
						$('.top').scrollTop(25 * index - 2);
					}, 100);					
					return;
				}
			}
			layer.msg('进程不存在');
        }

        function order(index, o, isf){            
            data.sort(function(a, b){
                if(index == 0){
                    return o > 0 ? a.name.localeCompare(b.name, 'zh-CN') : b.name.localeCompare(a.name, 'zh-CN');
                } else if(index == 1){
                    return parseInt(a.processId) < parseInt(b.processId) ? o : -o;
                } else if(index == 2){
                    return parseInt(a.parentId) < parseInt(b.parentId) ? o : -o;
                } else if(index == 3){
                    return o > 0 ? a.user.localeCompare(b.user, 'zh-CN') : b.user.localeCompare(a.user, 'zh-CN');
                } else if(index == 4){
                    return Number(a.memory) < Number(b.memory) ? o : -o;
                }
                return 0;
            });

            render(isf);
        }

		function getChooseRow(){
			return $('.dtr.active').data('id');
		}

		function getDataById(pid){
			if(!pid){
				return null;
			}
			for(var i = 0; i < data.length; i++){
				if(data[i].processId == pid){					
					return data[i];
				}
			}
			return null;
		}

		function getIndexById(pid){
			if(!pid){
				return -1;
			}
			for(var i = 0; i < data.length; i++){
				if(data[i].processId == pid){					
					return i;
				}
			}
			return -1;
		}

		function removeInfo(pid){
			if(!pid){
				return;
			}
			for(var i = 0; i < data.length; i++){
				if(data[i].processId == pid){
					$('.dtr.row' + pid).remove();
					$('.htr.row' + pid).remove();
					data.splice(i, 1);
					return;
				}
			}
		}

		function updateInfo(pid, obj){
			if(!pid || !obj){
				return;
			}
			var item = {};
			try{
				item = JSON.parse(obj);
				if(!item){
					return;
				}
			}catch(e2){
				alert("更新数据失败：" + e2);
				return;
			}
			for(var i = 0; i < data.length; i++){
				if(data[i].processId == pid){
					data[i] = item;
					changeDataInfo(i);
					changePidView(data[i]);
					return;
				}
			}
		}

		function changePidView(item){
			if(!item){
				return;
			}
			var dtrtpl = document.getElementById('dtr-td.tpl').innerHTML;
			var htrtpl = document.getElementById('htr-td.tpl').innerHTML;
			var dtrHtml = parse(dtrtpl, item);
			var htrHtml = parse(htrtpl, item);
			$('.dtr.row' + item.processId).html(dtrHtml);
			$('.htr.row' + item.processId).html(htrHtml);

			layer.msg('更新成功');
		}

		function showRightMenu(x, y, processId, parentId, name, winHwnd){
			//contentmenu
			var $menu = $('#contentmenu');
			var h = $menu.height();
			var maxh = $('body').height();
			$menu.css({"left": x, "top": y + h > maxh ? y - h - 13 : y}).removeClass('hidden');
		}

        window.onload = function(){
            //render();
            var winWidth = $(window).width();
			var selectId = -1;

			pageLoaded();

            $('#data-body').on('mousedown', '.dtr', function(e){
                var that = $(this);
                $('.dtr').removeClass('active');
                that.addClass('active');
                selectId = that.data('id');
				$('#contentmenu').addClass('hidden');

                var htr = $('.htr.row' + selectId);
				$('.htr').addClass('hidden').removeClass('open');
				if($('.htr.row' + selectId + '.hidden').length){
					htr.removeClass('hidden').addClass('open');
					loadOtherInfo(selectId);
				} else {
					htr.addClass('hidden').removeClass('open');
				}

				resizeTh();
            });

            $('#data-body').on('mouseup', '.dtr', function(e){
                if(e.button == 2){ // 鼠标右键                            
                    var obj = getDataById(selectId);
                    if(obj){
                        setTimeout(function(){
                            showRightMenu(e.clientX, e.clientY, obj.processId, obj.parentId, obj.name, obj.winHwnd);
                        }, 100);
                    }
                }
            });

            $('th.sort').on('click', function(){
                var that = $(this);
                var od = parseInt(that.data('id'));                
                $('.sort span').text('');
                if(that.hasClass('sort-down')){
                    $('.sort').removeClass('sort-up').removeClass('sort-down');
                    that.addClass('sort-up');
                    that.find('span').text('↑');                   
                    orderType = od;
                    orderWay = -1;
                } else {
                    $('.sort').removeClass('sort-up').removeClass('sort-down');
                    that.addClass('sort-down');
                    that.find('span').text('↓');
                    orderType = od;
                    orderWay = 1;
                }
                order(orderType, orderWay);
                resizeTh();
            });

            $('.top').scroll(function(){
                var topx = $('.top').scrollTop();
                var leftx = $('.top').scrollLeft();
                if(topx > 25){
                    if(!$('.clone-table').length){
                        var $thead = $('#process_table thead');
                        var $table = $('<table id="clone_table" class="clone-table" cellspacing="1" cellpadding="0"></table>');                        
                        $('.top').append($table.append($thead .clone().addClass('clone')));
                        $('.clone th').removeClass('sort');
                        $('.clone th span').text(' ');
                        $('.clone').css({width: $thead.width() + 'px', height: $thead.height() + 'px'})
                        $('.clone th').each(function(i, e){
                            if(i < 5){
                                $(this).css({
                                    "width": $('#process_table thead th:eq('+ i +')').width(),
                                    "min-width": $('#process_table thead th:eq('+ i +')').width(),
                                });                                
                            }    
                            $(this).css('padding', '1px 5px');   
                        });
                    }
                    $('.clone-table').show();
                } else {                    
                    $('.clone-table').hide();
                }

                if(leftx > 0){
                    $('.clone-table').css({
                        left: (-leftx) + 'px',
                        width: 'calc(100% + ' + leftx + 'px)'
                    });                    
                } else {
                    $('.clone-table').css({
                        left: '0px',
                        width: '100%'
                    });
                }
            });

            $(window).on('resize', function(e){
                var newWidth = $(window).width();
                if(winWidth != newWidth){
                    winWidth = newWidth;
                    resizeTh();
                }
            });

			$('body').on('keyup', '.layui-layer-input', function(e){
                if(e.keyCode == 13){
                    if(!$(this).val()){
                        return;
                    }
                    layer.closeAll();
                    searchData($(this).val());
                }
            });

			$('.mitem').on('click', function(){
				var that = $(this);
				if(!that.hasClass('disable')){
					var pid = getChooseRow();
					if(that.hasClass('close')){
						ee.dialogOpenAlert({"title": "警告", "tips": "您确定要结束此进程吗？", "button": 1, "timeout": 5000}, function(ret){
							if(ret.index == 0){
								ee.processOver({"pid": pid}, function(r){
									if(r.status){
										layer.msg('进程已结束');
										flushData();
									}
								});
							}
						});						
					} else if(that.hasClass('opendir')){
						var i = getIndexById(pid);
						if(i >= 0 && data[i].path){
							ee.fileLocationFile({"path": data[i].path});
						}
					} else if(that.hasClass('copyid')){
						if(pid){
							ee.clipboardSetText({"text": "" + pid}, function(r){
								r.status && layer.msg('复制成功');
							});
						}
					} else if(that.hasClass('copyname')){
						var i = getIndexById(pid);
						if(i >= 0 && data[i].name){
							ee.clipboardSetText({"text": data[i].name}, function(r){
								r.status && layer.msg('复制成功');
							});
						}
					} else if(that.hasClass('copypath')){
						var i = getIndexById(pid);
						if(i >= 0 && data[i].path){
							ee.clipboardSetText({"text": data[i].path}, function(r){
								r.status && layer.msg('复制成功');
							});
						}
					} else if(that.hasClass('memory')){
						ee.processOpen({"pid": pid, "permiss": 2035711}, function(ret){
							if(ret.hwnd){
								ee.processOptimizingMemory({"hwnd": ret.hwnd}, function(rr){
									ee.processClose({"hwnd": ret.hwnd});
								});								
							}
						});						
					} else if(that.hasClass('module')){
						var i = getIndexById(pid);
						if(i >= 0 && data[i].name){
							openWindow(data[i].name + ' 的模块列表', './dll_module.html?pid='+pid+"&name=" + encodeURIComponent(data[i].name));
						}
					} else if(that.hasClass('object')){
						var i = getIndexById(pid);
						if(i >= 0 && data[i].name){
							openWindow(data[i].name + ' 的对象列表', './object.html?pid='+pid+"&name=" + encodeURIComponent(data[i].name));
						}
					} else if(that.hasClass('flush')){
						flushData();
					} else if(that.hasClass('search')){
						showSearch();
					}
					$('#contentmenu').addClass('hidden');
				}
			});
        }

		var layerIndex = 0;
		function openWindow(title, url){
			layerIndex = layer.open({
				type: 2,
				title: title,
				shadeClose: false,
				shade: 0.5,
				maxmin: true, //开启最大化最小化按钮
				area: ['850px', '550px'],
				content: url
			});
		}

        function resizeTh(){
            var $thead = $('#process_table thead');
            $('.clone').css({width: $thead.width() + 'px', height: $thead.height() + 'px'})
            $('.clone th').each(function(i, e){
                if(i < 5){
					$(this).css({
						"width": $('#process_table thead th:eq('+ i +')').width(),
						"min-width": $('#process_table thead th:eq('+ i +')').width(),
					});
                }    
                $(this).css('padding', '1px 5px');                        
            });
        }
    </script>

    <script id="tr.tpl" type="text/html">
        <tr class="dtr row{processId}" data-id="{processId}">
            <td class="itd"><img src="{icon}" width="16" height="16" /></td>
            <td>{name}</td>
            <td>{processId}</td>
            <td>{parentId}</td>
            <td>{user}</td>
            <td>{memory} MB</td>                        
        </tr>
        <tr class="htr row{processId} hidden" data-id="{processId}">
            <td colspan="6" class="coltd">
                <table class="child-table" cellspacing="1" cellpadding="0">
                    <tr>
						<td class="td1">创建时间</td>
                        <td class="td2">{createTime}</td>
                        <td class="td1">计算机域</td>
                        <td class="td2">{domain}</td>                        
                    </tr>
                    <tr>
						<td class="td1">优先级</td>
                        <td class="td2">{priority}</td>
                        <td class="td1">线程数</td>
                        <td class="td2">{threadCount}</td>                        
                    </tr>
                    <tr>
                        
                        <td class="td1">窗口句柄</td>
                        <td class="td2 wh">{winHwnd}</td>
						<td class="td1">句柄数</td>
                        <td class="td2">{processHwndCount}</td>
                    </tr>
                    <tr>
                        <td class="td1">窗口标题</td>
                        <td class="td2 wt">{winTitle}</td>
                        <td class="td1">窗口类名</td>
                        <td class="td2 wc">{winClass}</td>
                    </tr>
                    <tr>
                        <td class="td1">进程路径</td>
                        <td class="td2 pa">{path}</td>
                        <td class="td1">命令行</td>
                        <td class="td2 cm">{cmd}</td>
                    </tr>
                </table>
            </td>            
        </tr>
    </script>

	<script id="dtr-td.tpl" type="text/html">
		<td class="itd"><img src="{icon}" width="16" height="16" /></td>
		<td>{name}</td>
		<td>{processId}</td>
		<td>{parentId}</td>
		<td>{user}</td>
		<td>{memory}</td>
	</script>

	<script id="htr-td.tpl" type="text/html">
		<td colspan="6" class="coltd">
			<table class="child-table" cellspacing="1" cellpadding="0">
				<tr>
					<td class="td1">创建时间</td>
					<td class="td2">{createTime}</td>
					<td class="td1">计算机域</td>
					<td class="td2">{domain}</td>                        
				</tr>
				<tr>
					<td class="td1">优先级</td>
					<td class="td2">{priority}</td>
					<td class="td1">线程数</td>
					<td class="td2">{threadCount}</td>                        
				</tr>
				<tr>
					
					<td class="td1">窗口句柄</td>
					<td class="td2">{winHwnd}</td>
					<td class="td1">句柄数</td>
					<td class="td2">{processHwndCount}</td>
				</tr>
				<tr>
					<td class="td1">窗口标题</td>
					<td class="td2">{winTitle}</td>
					<td class="td1">窗口类名</td>
					<td class="td2">{winClass}</td>
				</tr>
				<tr>
					<td class="td1">进程路径</td>
					<td class="td2">{path}</td>
					<td class="td1">命令行</td>
					<td class="td2">{cmd}</td>
				</tr>
			</table>
		</td>            
    </script>

</body>
</html>